package com.maikang.exammall.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

@Configuration
public class TheadPoolExecutorConfiguration {
    
    @Bean
    public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
    	ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
    	taskExecutor.setCorePoolSize(4);
    	taskExecutor.setMaxPoolSize(5);
    	taskExecutor.setQueueCapacity(50);
    	taskExecutor.setThreadNamePrefix("exam-mall");
    	return taskExecutor;
    }
}
